package com.qf.myrbac.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class PageVo<T> {
    private Long totalCount;
    private Long pageSize;
    private Long totalPage;
    private Long currPage;
    private List<T> list;

    public PageVo(Page<T> page) {
        this.setTotalCount(page.getTotal());
        this.setPageSize(page.getSize());
        this.setTotalPage(page.getPages());
        this.setCurrPage(page.getCurrent());
        this.setList(page.getRecords());
    }
}
